package com.wangdao.mall.service;

import com.wangdao.mall.model.Admin;
import com.wangdao.mall.dao.AdminDao;
import com.wangdao.mall.dao.AdminDaoImp;
import com.wangdao.mall.model.Password;

import java.util.List;

/**
 * @Author:HaiyangTian
 * @Description:
 * @Date: Created in 17:34 2020/4/29
 * @Modified By:
 */
public class AdminServiceImp implements AdminService {

    //引用dao层来处理数据
    private AdminDao adminDao = new AdminDaoImp();

    @Override
    public int login(Admin admin) {
        return adminDao.login(admin);
    }

    @Override
    public List<Admin> allAdmins() {
        return adminDao.allAdmins();
    }

    @Override
    public List<Admin> getSearchAdmins(Admin params) {

        return adminDao.getSearchAdmins(params);
    }

    @Override
    public int deleteAdmins(String id) {
        return adminDao.deleteAdmins(id);
    }

    @Override
    public int addAdmins(Admin admin) {
        return adminDao.addAdmins(admin);
    }

    @Override
    public int changePwd(Password pwds,String admin) {
        return adminDao.changePwd(pwds,admin);
    }

    @Override
    public Admin getAdminsInfo(String id) {
        return adminDao.getAdminsInfo(id);
    }

    @Override
    public void updateAdmins(Admin admin) {
        adminDao.updateAdmins(admin);
    }
}
